//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_exported import SotoCore

/// Service object for interacting with AWS ServerlessApplicationRepository service.
///
/// The AWS Serverless Application Repository makes it easy for developers and enterprises to quickly find and deploy serverless applications in the AWS Cloud. For more information about serverless applications, see Serverless Computing and Applications on the AWS website.The AWS Serverless Application Repository is deeply integrated with the AWS Lambda console, so that developers of  all levels can get started with serverless computing without needing to learn anything new. You can use category  keywords to browse for applications such as web and mobile backends, data processing applications, or chatbots.  You can also search for applications by name, publisher, or event source. To use an application, you simply choose it,  configure any required fields, and deploy it with a few clicks. You can also easily publish applications, sharing them publicly with the community at large, or privately within your team or across your organization. To publish a serverless application (or app), you can use the AWS Management Console, AWS Command Line Interface (AWS CLI), or AWS SDKs to upload the code. Along with the code, you upload a simple manifest file, also known as the AWS Serverless Application Model (AWS SAM) template. For more information about AWS SAM, see AWS Serverless Application Model (AWS SAM) on the AWS Labs GitHub repository.The AWS Serverless Application Repository Developer Guide contains more information about the two developer experiences available:  Consuming Applications – Browse for applications and view information about them, including source code and readme files. Also install, configure, and deploy applications of your choosing.  Publishing Applications – Configure and upload applications to make them available to other developers, and publish new versions of applications.
public struct ServerlessApplicationRepository: AWSService {
    // MARK: Member variables

    /// Client used for communication with AWS
    public let client: AWSClient
    /// Service configuration
    public let config: AWSServiceConfig

    // MARK: Initialization

    /// Initialize the ServerlessApplicationRepository client
    /// - parameters:
    ///     - client: AWSClient used to process requests
    ///     - region: Region of server you want to communicate with. This will override the partition parameter.
    ///     - partition: AWS partition where service resides, standard (.aws), china (.awscn), government (.awsusgov).
    ///     - endpoint: Custom endpoint URL to use instead of standard AWS servers
    ///     - middleware: Middleware chain used to edit requests before they are sent and responses before they are decoded 
    ///     - timeout: Timeout value for HTTP requests
    ///     - byteBufferAllocator: Allocator for ByteBuffers
    ///     - options: Service options
    public init(
        client: AWSClient,
        region: SotoCore.Region? = nil,
        partition: AWSPartition = .aws,
        endpoint: String? = nil,
        middleware: AWSMiddlewareProtocol? = nil,
        timeout: TimeAmount? = nil,
        byteBufferAllocator: ByteBufferAllocator = ByteBufferAllocator(),
        options: AWSServiceConfig.Options = []
    ) {
        self.client = client
        self.config = AWSServiceConfig(
            region: region,
            partition: region?.partition ?? partition,
            serviceName: "ServerlessApplicationRepository",
            serviceIdentifier: "serverlessrepo",
            serviceProtocol: .restjson,
            apiVersion: "2017-09-08",
            endpoint: endpoint,
            variantEndpoints: Self.variantEndpoints,
            errorType: ServerlessApplicationRepositoryErrorType.self,
            middleware: middleware,
            timeout: timeout,
            byteBufferAllocator: byteBufferAllocator,
            options: options
        )
    }




    /// FIPS and dualstack endpoints
    static var variantEndpoints: [EndpointVariantType: AWSServiceConfig.EndpointVariant] {[
        [.fips]: .init(endpoints: [
            "ca-central-1": "serverlessrepo-fips.ca-central-1.amazonaws.com",
            "us-east-1": "serverlessrepo-fips.us-east-1.amazonaws.com",
            "us-east-2": "serverlessrepo-fips.us-east-2.amazonaws.com",
            "us-gov-east-1": "serverlessrepo.us-gov-east-1.amazonaws.com",
            "us-gov-west-1": "serverlessrepo.us-gov-west-1.amazonaws.com",
            "us-west-1": "serverlessrepo-fips.us-west-1.amazonaws.com",
            "us-west-2": "serverlessrepo-fips.us-west-2.amazonaws.com"
        ])
    ]}

    // MARK: API Calls

    /// Creates an application, optionally including an AWS SAM file to create the first application version in the same call.
    @Sendable
    @inlinable
    public func createApplication(_ input: CreateApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateApplicationResponse {
        try await self.client.execute(
            operation: "CreateApplication", 
            path: "/applications", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an application, optionally including an AWS SAM file to create the first application version in the same call.
    ///
    /// Parameters:
    ///   - author: The name of the author publishing the app.Minimum length=1. Maximum length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
    ///   - description: The description of the application.Minimum length=1. Maximum length=256
    ///   - homePageUrl: A URL with more information about the application, for example the location of your GitHub repository for the application.
    ///   - labels: Labels to improve discovery of apps in search results.Minimum length=1. Maximum length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
    ///   - licenseBody: A local text file that contains the license of the app that matches the spdxLicenseID value of your application. The file has the format file://&lt;path>/&lt;filename>.Maximum size 5 MBYou can specify only one of licenseBody and licenseUrl; otherwise, an error results.
    ///   - licenseUrl: A link to the S3 object that contains the license of the app that matches the spdxLicenseID value of your application.Maximum size 5 MBYou can specify only one of licenseBody and licenseUrl; otherwise, an error results.
    ///   - name: The name of the application that you want to publish.Minimum length=1. Maximum length=140Pattern: "[a-zA-Z0-9\\-]+";
    ///   - readmeBody: A local text readme file in Markdown language that contains a more detailed description of the application and how it works. The file has the format file://&lt;path>/&lt;filename>.Maximum size 5 MBYou can specify only one of readmeBody and readmeUrl; otherwise, an error results.
    ///   - readmeUrl: A link to the S3 object in Markdown language that contains a more detailed description of the application and how it works.Maximum size 5 MBYou can specify only one of readmeBody and readmeUrl; otherwise, an error results.
    ///   - semanticVersion: The semantic version of the application: https://semver.org/
    ///   - sourceCodeArchiveUrl: A link to the S3 object that contains the ZIP archive of the source code for this version of your application.Maximum size 50 MB
    ///   - sourceCodeUrl: A link to a public repository for the source code of your application, for example the URL of a specific GitHub commit.
    ///   - spdxLicenseId: A valid identifier from https://spdx.org/licenses/.
    ///   - templateBody: The local raw packaged AWS SAM template file of your application. The file has the format file://&lt;path>/&lt;filename>.You can specify only one of templateBody and templateUrl; otherwise an error results.
    ///   - templateUrl: A link to the S3 object containing the packaged AWS SAM template of your application.You can specify only one of templateBody and templateUrl; otherwise an error results.
    ///   - logger: Logger use during operation
    @inlinable
    public func createApplication(
        author: String? = nil,
        description: String? = nil,
        homePageUrl: String? = nil,
        labels: [String]? = nil,
        licenseBody: String? = nil,
        licenseUrl: String? = nil,
        name: String? = nil,
        readmeBody: String? = nil,
        readmeUrl: String? = nil,
        semanticVersion: String? = nil,
        sourceCodeArchiveUrl: String? = nil,
        sourceCodeUrl: String? = nil,
        spdxLicenseId: String? = nil,
        templateBody: String? = nil,
        templateUrl: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateApplicationResponse {
        let input = CreateApplicationRequest(
            author: author, 
            description: description, 
            homePageUrl: homePageUrl, 
            labels: labels, 
            licenseBody: licenseBody, 
            licenseUrl: licenseUrl, 
            name: name, 
            readmeBody: readmeBody, 
            readmeUrl: readmeUrl, 
            semanticVersion: semanticVersion, 
            sourceCodeArchiveUrl: sourceCodeArchiveUrl, 
            sourceCodeUrl: sourceCodeUrl, 
            spdxLicenseId: spdxLicenseId, 
            templateBody: templateBody, 
            templateUrl: templateUrl
        )
        return try await self.createApplication(input, logger: logger)
    }

    /// Creates an application version.
    @Sendable
    @inlinable
    public func createApplicationVersion(_ input: CreateApplicationVersionRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateApplicationVersionResponse {
        try await self.client.execute(
            operation: "CreateApplicationVersion", 
            path: "/applications/{ApplicationId}/versions/{SemanticVersion}", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an application version.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - semanticVersion: The semantic version of the new version.
    ///   - sourceCodeArchiveUrl: A link to the S3 object that contains the ZIP archive of the source code for this version of your application.Maximum size 50 MB
    ///   - sourceCodeUrl: A link to a public repository for the source code of your application, for example the URL of a specific GitHub commit.
    ///   - templateBody: The raw packaged AWS SAM template of your application.
    ///   - templateUrl: A link to the packaged AWS SAM template of your application.
    ///   - logger: Logger use during operation
    @inlinable
    public func createApplicationVersion(
        applicationId: String,
        semanticVersion: String,
        sourceCodeArchiveUrl: String? = nil,
        sourceCodeUrl: String? = nil,
        templateBody: String? = nil,
        templateUrl: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateApplicationVersionResponse {
        let input = CreateApplicationVersionRequest(
            applicationId: applicationId, 
            semanticVersion: semanticVersion, 
            sourceCodeArchiveUrl: sourceCodeArchiveUrl, 
            sourceCodeUrl: sourceCodeUrl, 
            templateBody: templateBody, 
            templateUrl: templateUrl
        )
        return try await self.createApplicationVersion(input, logger: logger)
    }

    /// Creates an AWS CloudFormation change set for the given application.
    @Sendable
    @inlinable
    public func createCloudFormationChangeSet(_ input: CreateCloudFormationChangeSetRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCloudFormationChangeSetResponse {
        try await self.client.execute(
            operation: "CreateCloudFormationChangeSet", 
            path: "/applications/{ApplicationId}/changesets", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an AWS CloudFormation change set for the given application.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - capabilities: A list of values that you must specify before you can deploy certain applications. Some applications might include resources that can affect permissions in your AWS account, for example, by creating new AWS Identity and Access Management (IAM) users. For those applications, you must explicitly acknowledge their capabilities by specifying this parameter.The only valid values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, and CAPABILITY_AUTO_EXPAND.The following resources require you to specify CAPABILITY_IAM or CAPABILITY_NAMED_IAM: AWS::IAM::Group, AWS::IAM::InstanceProfile, AWS::IAM::Policy, and AWS::IAM::Role. If the application contains IAM resources, you can specify either CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM resources with custom names, you must specify CAPABILITY_NAMED_IAM.The following resources require you to specify CAPABILITY_RESOURCE_POLICY: AWS::Lambda::Permission, AWS::IAM:Policy, AWS::ApplicationAutoScaling::ScalingPolicy, AWS::S3::BucketPolicy, AWS::SQS::QueuePolicy, and AWS::SNS:TopicPolicy.Applications that contain one or more nested applications require you to specify CAPABILITY_AUTO_EXPAND.If your application template contains any of the above resources, we recommend that you review all permissions associated with the application before deploying. If you don't specify this parameter for an application that requires capabilities, the call will fail.
    ///   - changeSetName: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - clientToken: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - description: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - notificationArns: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - parameterOverrides: A list of parameter values for the parameters of the application.
    ///   - resourceTypes: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - rollbackConfiguration: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - semanticVersion: The semantic version of the application: https://semver.org/
    ///   - stackName: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - tags: This property corresponds to the parameter of the same name for the AWS CloudFormation CreateChangeSet API.
    ///   - templateId: The UUID returned by CreateCloudFormationTemplate.Pattern: [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}
    ///   - logger: Logger use during operation
    @inlinable
    public func createCloudFormationChangeSet(
        applicationId: String,
        capabilities: [String]? = nil,
        changeSetName: String? = nil,
        clientToken: String? = nil,
        description: String? = nil,
        notificationArns: [String]? = nil,
        parameterOverrides: [ParameterValue]? = nil,
        resourceTypes: [String]? = nil,
        rollbackConfiguration: RollbackConfiguration? = nil,
        semanticVersion: String? = nil,
        stackName: String? = nil,
        tags: [Tag]? = nil,
        templateId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCloudFormationChangeSetResponse {
        let input = CreateCloudFormationChangeSetRequest(
            applicationId: applicationId, 
            capabilities: capabilities, 
            changeSetName: changeSetName, 
            clientToken: clientToken, 
            description: description, 
            notificationArns: notificationArns, 
            parameterOverrides: parameterOverrides, 
            resourceTypes: resourceTypes, 
            rollbackConfiguration: rollbackConfiguration, 
            semanticVersion: semanticVersion, 
            stackName: stackName, 
            tags: tags, 
            templateId: templateId
        )
        return try await self.createCloudFormationChangeSet(input, logger: logger)
    }

    /// Creates an AWS CloudFormation template.
    @Sendable
    @inlinable
    public func createCloudFormationTemplate(_ input: CreateCloudFormationTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> CreateCloudFormationTemplateResponse {
        try await self.client.execute(
            operation: "CreateCloudFormationTemplate", 
            path: "/applications/{ApplicationId}/templates", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Creates an AWS CloudFormation template.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - semanticVersion: The semantic version of the application: https://semver.org/
    ///   - logger: Logger use during operation
    @inlinable
    public func createCloudFormationTemplate(
        applicationId: String,
        semanticVersion: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> CreateCloudFormationTemplateResponse {
        let input = CreateCloudFormationTemplateRequest(
            applicationId: applicationId, 
            semanticVersion: semanticVersion
        )
        return try await self.createCloudFormationTemplate(input, logger: logger)
    }

    /// Deletes the specified application.
    @Sendable
    @inlinable
    public func deleteApplication(_ input: DeleteApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "DeleteApplication", 
            path: "/applications/{ApplicationId}", 
            httpMethod: .DELETE, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Deletes the specified application.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func deleteApplication(
        applicationId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = DeleteApplicationRequest(
            applicationId: applicationId
        )
        return try await self.deleteApplication(input, logger: logger)
    }

    /// Gets the specified application.
    @Sendable
    @inlinable
    public func getApplication(_ input: GetApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetApplicationResponse {
        try await self.client.execute(
            operation: "GetApplication", 
            path: "/applications/{ApplicationId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the specified application.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - semanticVersion: The semantic version of the application to get.
    ///   - logger: Logger use during operation
    @inlinable
    public func getApplication(
        applicationId: String,
        semanticVersion: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetApplicationResponse {
        let input = GetApplicationRequest(
            applicationId: applicationId, 
            semanticVersion: semanticVersion
        )
        return try await self.getApplication(input, logger: logger)
    }

    /// Retrieves the policy for the application.
    @Sendable
    @inlinable
    public func getApplicationPolicy(_ input: GetApplicationPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetApplicationPolicyResponse {
        try await self.client.execute(
            operation: "GetApplicationPolicy", 
            path: "/applications/{ApplicationId}/policy", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the policy for the application.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func getApplicationPolicy(
        applicationId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetApplicationPolicyResponse {
        let input = GetApplicationPolicyRequest(
            applicationId: applicationId
        )
        return try await self.getApplicationPolicy(input, logger: logger)
    }

    /// Gets the specified AWS CloudFormation template.
    @Sendable
    @inlinable
    public func getCloudFormationTemplate(_ input: GetCloudFormationTemplateRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> GetCloudFormationTemplateResponse {
        try await self.client.execute(
            operation: "GetCloudFormationTemplate", 
            path: "/applications/{ApplicationId}/templates/{TemplateId}", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Gets the specified AWS CloudFormation template.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - templateId: The UUID returned by CreateCloudFormationTemplate.Pattern: [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}
    ///   - logger: Logger use during operation
    @inlinable
    public func getCloudFormationTemplate(
        applicationId: String,
        templateId: String,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> GetCloudFormationTemplateResponse {
        let input = GetCloudFormationTemplateRequest(
            applicationId: applicationId, 
            templateId: templateId
        )
        return try await self.getCloudFormationTemplate(input, logger: logger)
    }

    /// Retrieves the list of applications nested in the containing application.
    @Sendable
    @inlinable
    public func listApplicationDependencies(_ input: ListApplicationDependenciesRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationDependenciesResponse {
        try await self.client.execute(
            operation: "ListApplicationDependencies", 
            path: "/applications/{ApplicationId}/dependencies", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Retrieves the list of applications nested in the containing application.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - maxItems: The total number of items to return.
    ///   - nextToken: A token to specify where to start paginating.
    ///   - semanticVersion: The semantic version of the application to get.
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplicationDependencies(
        applicationId: String,
        maxItems: Int? = nil,
        nextToken: String? = nil,
        semanticVersion: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationDependenciesResponse {
        let input = ListApplicationDependenciesRequest(
            applicationId: applicationId, 
            maxItems: maxItems, 
            nextToken: nextToken, 
            semanticVersion: semanticVersion
        )
        return try await self.listApplicationDependencies(input, logger: logger)
    }

    /// Lists versions for the specified application.
    @Sendable
    @inlinable
    public func listApplicationVersions(_ input: ListApplicationVersionsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationVersionsResponse {
        try await self.client.execute(
            operation: "ListApplicationVersions", 
            path: "/applications/{ApplicationId}/versions", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists versions for the specified application.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - maxItems: The total number of items to return.
    ///   - nextToken: A token to specify where to start paginating.
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplicationVersions(
        applicationId: String,
        maxItems: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationVersionsResponse {
        let input = ListApplicationVersionsRequest(
            applicationId: applicationId, 
            maxItems: maxItems, 
            nextToken: nextToken
        )
        return try await self.listApplicationVersions(input, logger: logger)
    }

    /// Lists applications owned by the requester.
    @Sendable
    @inlinable
    public func listApplications(_ input: ListApplicationsRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> ListApplicationsResponse {
        try await self.client.execute(
            operation: "ListApplications", 
            path: "/applications", 
            httpMethod: .GET, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Lists applications owned by the requester.
    ///
    /// Parameters:
    ///   - maxItems: The total number of items to return.
    ///   - nextToken: A token to specify where to start paginating.
    ///   - logger: Logger use during operation
    @inlinable
    public func listApplications(
        maxItems: Int? = nil,
        nextToken: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> ListApplicationsResponse {
        let input = ListApplicationsRequest(
            maxItems: maxItems, 
            nextToken: nextToken
        )
        return try await self.listApplications(input, logger: logger)
    }

    /// Sets the permission policy for an application. For the list of actions supported for this operation, see Application  Permissions .
    @Sendable
    @inlinable
    public func putApplicationPolicy(_ input: PutApplicationPolicyRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> PutApplicationPolicyResponse {
        try await self.client.execute(
            operation: "PutApplicationPolicy", 
            path: "/applications/{ApplicationId}/policy", 
            httpMethod: .PUT, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Sets the permission policy for an application. For the list of actions supported for this operation, see Application  Permissions .
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - statements: An array of policy statements applied to the application.
    ///   - logger: Logger use during operation
    @inlinable
    public func putApplicationPolicy(
        applicationId: String,
        statements: [ApplicationPolicyStatement]? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> PutApplicationPolicyResponse {
        let input = PutApplicationPolicyRequest(
            applicationId: applicationId, 
            statements: statements
        )
        return try await self.putApplicationPolicy(input, logger: logger)
    }

    /// Unshares an application from an AWS Organization.This operation can be called only from the organization's master account.
    @Sendable
    @inlinable
    public func unshareApplication(_ input: UnshareApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws {
        try await self.client.execute(
            operation: "UnshareApplication", 
            path: "/applications/{ApplicationId}/unshare", 
            httpMethod: .POST, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Unshares an application from an AWS Organization.This operation can be called only from the organization's master account.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - organizationId: The AWS Organization ID to unshare the application from.
    ///   - logger: Logger use during operation
    @inlinable
    public func unshareApplication(
        applicationId: String,
        organizationId: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws {
        let input = UnshareApplicationRequest(
            applicationId: applicationId, 
            organizationId: organizationId
        )
        return try await self.unshareApplication(input, logger: logger)
    }

    /// Updates the specified application.
    @Sendable
    @inlinable
    public func updateApplication(_ input: UpdateApplicationRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> UpdateApplicationResponse {
        try await self.client.execute(
            operation: "UpdateApplication", 
            path: "/applications/{ApplicationId}", 
            httpMethod: .PATCH, 
            serviceConfig: self.config, 
            input: input, 
            logger: logger
        )
    }
    /// Updates the specified application.
    ///
    /// Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - author: The name of the author publishing the app.Minimum length=1. Maximum length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
    ///   - description: The description of the application.Minimum length=1. Maximum length=256
    ///   - homePageUrl: A URL with more information about the application, for example the location of your GitHub repository for the application.
    ///   - labels: Labels to improve discovery of apps in search results.Minimum length=1. Maximum length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
    ///   - readmeBody: A text readme file in Markdown language that contains a more detailed description of the application and how it works.Maximum size 5 MB
    ///   - readmeUrl: A link to the readme file in Markdown language that contains a more detailed description of the application and how it works.Maximum size 5 MB
    ///   - logger: Logger use during operation
    @inlinable
    public func updateApplication(
        applicationId: String,
        author: String? = nil,
        description: String? = nil,
        homePageUrl: String? = nil,
        labels: [String]? = nil,
        readmeBody: String? = nil,
        readmeUrl: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) async throws -> UpdateApplicationResponse {
        let input = UpdateApplicationRequest(
            applicationId: applicationId, 
            author: author, 
            description: description, 
            homePageUrl: homePageUrl, 
            labels: labels, 
            readmeBody: readmeBody, 
            readmeUrl: readmeUrl
        )
        return try await self.updateApplication(input, logger: logger)
    }
}

extension ServerlessApplicationRepository {
    /// Initializer required by `AWSService.with(middlewares:timeout:byteBufferAllocator:options)`. You are not able to use this initializer directly as there are not public
    /// initializers for `AWSServiceConfig.Patch`. Please use `AWSService.with(middlewares:timeout:byteBufferAllocator:options)` instead.
    public init(from: ServerlessApplicationRepository, patch: AWSServiceConfig.Patch) {
        self.client = from.client
        self.config = from.config.with(patch: patch)
    }
}

// MARK: Paginators

@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension ServerlessApplicationRepository {
    /// Return PaginatorSequence for operation ``listApplicationDependencies(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationDependenciesPaginator(
        _ input: ListApplicationDependenciesRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationDependenciesRequest, ListApplicationDependenciesResponse> {
        return .init(
            input: input,
            command: self.listApplicationDependencies,
            inputKey: \ListApplicationDependenciesRequest.nextToken,
            outputKey: \ListApplicationDependenciesResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplicationDependencies(_:logger:)``.
    ///
    /// - Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - maxItems: The total number of items to return.
    ///   - semanticVersion: The semantic version of the application to get.
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationDependenciesPaginator(
        applicationId: String,
        maxItems: Int? = nil,
        semanticVersion: String? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationDependenciesRequest, ListApplicationDependenciesResponse> {
        let input = ListApplicationDependenciesRequest(
            applicationId: applicationId, 
            maxItems: maxItems, 
            semanticVersion: semanticVersion
        )
        return self.listApplicationDependenciesPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listApplicationVersions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationVersionsPaginator(
        _ input: ListApplicationVersionsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationVersionsRequest, ListApplicationVersionsResponse> {
        return .init(
            input: input,
            command: self.listApplicationVersions,
            inputKey: \ListApplicationVersionsRequest.nextToken,
            outputKey: \ListApplicationVersionsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplicationVersions(_:logger:)``.
    ///
    /// - Parameters:
    ///   - applicationId: The Amazon Resource Name (ARN) of the application.
    ///   - maxItems: The total number of items to return.
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationVersionsPaginator(
        applicationId: String,
        maxItems: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationVersionsRequest, ListApplicationVersionsResponse> {
        let input = ListApplicationVersionsRequest(
            applicationId: applicationId, 
            maxItems: maxItems
        )
        return self.listApplicationVersionsPaginator(input, logger: logger)
    }

    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - input: Input for operation
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        _ input: ListApplicationsRequest,
        logger: Logger = AWSClient.loggingDisabled
    ) -> AWSClient.PaginatorSequence<ListApplicationsRequest, ListApplicationsResponse> {
        return .init(
            input: input,
            command: self.listApplications,
            inputKey: \ListApplicationsRequest.nextToken,
            outputKey: \ListApplicationsResponse.nextToken,
            logger: logger
        )
    }
    /// Return PaginatorSequence for operation ``listApplications(_:logger:)``.
    ///
    /// - Parameters:
    ///   - maxItems: The total number of items to return.
    ///   - logger: Logger used for logging
    @inlinable
    public func listApplicationsPaginator(
        maxItems: Int? = nil,
        logger: Logger = AWSClient.loggingDisabled        
    ) -> AWSClient.PaginatorSequence<ListApplicationsRequest, ListApplicationsResponse> {
        let input = ListApplicationsRequest(
            maxItems: maxItems
        )
        return self.listApplicationsPaginator(input, logger: logger)
    }
}

extension ServerlessApplicationRepository.ListApplicationDependenciesRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServerlessApplicationRepository.ListApplicationDependenciesRequest {
        return .init(
            applicationId: self.applicationId,
            maxItems: self.maxItems,
            nextToken: token,
            semanticVersion: self.semanticVersion
        )
    }
}

extension ServerlessApplicationRepository.ListApplicationVersionsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServerlessApplicationRepository.ListApplicationVersionsRequest {
        return .init(
            applicationId: self.applicationId,
            maxItems: self.maxItems,
            nextToken: token
        )
    }
}

extension ServerlessApplicationRepository.ListApplicationsRequest: AWSPaginateToken {
    @inlinable
    public func usingPaginationToken(_ token: String) -> ServerlessApplicationRepository.ListApplicationsRequest {
        return .init(
            maxItems: self.maxItems,
            nextToken: token
        )
    }
}
